{include file="./public/footer" /}
{include file="./public/menu" /}
<!--/sidebar-->
<div class="main-wrap">

    <div class="crumb-wrap">
        <div class="crumb-list"><i class="icon-font"></i><a href="/admin.php">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">权限管理</span></div>
    </div>
    <div class="result-wrap">
        <form name="myform" id="andy_sort">
            <div class="result-title">
                <div class="result-list">
                    <button type="button" id="button_add" ><i class="icon-font"></i>新增权限</button>
                    <button type="button" id="button_group"><i class="icon-font"></i>角色管理</button>
                    <button type="button" id="button_admin"><i class="icon-font"></i>管理员管理</button>
                </div>
            </div>
            <div class="result-content">
                <table class="result-tab" width="100%">
                    <tr>
                        <th>ID</th>
                        <th>权限名</th>
                        <th>审核状态</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                    {volist name="rule" id="r"}
                        <tr style="text-align: center;">

                            <td>{$r.rule_id}</td>
                            <td>{if ($r.pid neq 0)}|{/if}<?php echo str_repeat('-',$r['level']*8);?>{$r.rule_name}</td>
                            <td><a href="">{$r.rule_status|getRuleStatus}</a></td>
                            <td>{$r.update_time|date="Y-m-d H:i:s",###}</td>
                            <td>
                                <a href="#"><span onclick="edit.click(this)" attr-id="{$r.rule_id}" >修改</span></a>
                                <a href="#"><span onclick="del.click(this)" attr-id="{$r.rule_id}" attr-msg="删除" attr-a="rule">删除</span></a>
                            </td>
                        </tr>
                    {/volist}
                </table>
            </div>
        </form>
    </div>
</div>
<script>
    var SCOPE = {
        'add_url' : '/admin.php/rule/add',
        'edit_url' : '/admin.php/rule/edit',
        'set_status_url' : '/admin.php/rule/setStatus',
        'group_url' : '/admin.php/group/lists',
        'admin_url' : '/admin.php/admin/lists',
    };

    $("#button_admin").click(function(){
        var url = SCOPE.admin_url;

        window.location.href = url;
    });
</script>
<!--/main-->
{include file="./public/bottom" /}